<?php
class Config extends ArrayObject
{
	private $_data = NULL;

	function __construct($name, $set = NULL)
	{
		parent::__construct(self::get($name, $set));
	}
	
	public static function get($name, $set = NULL)
	{
		$file = "Config/" . $name . ".php";
		if (file_exists($file))
		{
			include $file;
		}
		$var = "config_" . $name;
		$var = $$var;
		
		if ($set !== NULL)
		{
			return $var[$set];
		}
		else
		{
			return $var;
		}
	}
}